package cc.rengu.igas.bsps.common.enums;

/**
 * 缴费类型枚举
 * Created by 王成 on 2018/12/10.
 */
public enum PayFeeTypeEnum {
    ELECTRIC("00", "电费"),
    WATER("01", "水费"),
    GAS("02", "燃气费"),
    PROPERTY("03", "物业费"),
    CATV("04", "有线电视费"),
    BROADBAND("05", "宽带费"),
    TELEPHONE("06", "固话费");
    private String feeType;
    private String feeDesc;

    PayFeeTypeEnum(String feeType, String feeDesc) {
        this.feeType = feeType;
        this.feeDesc = feeDesc;
    }

    public String getFeeType() {
        return feeType;
    }

    public void setFeeType(String feeType) {
        this.feeType = feeType;
    }

    public String getFeeDesc() {
        return feeDesc;
    }

    public void setFeeDesc(String feeDesc) {
        this.feeDesc = feeDesc;
    }

    /**
     * 将接口中的缴费类型转换成缴费通道的缴费类型
     *
     * @param feeType   接口中的缴费类型
     * @param channelId 通道标识
     * @return 通道缴费类型
     */
    public static String changePayFeeType(String feeType, String channelId) {
        switch (channelId) {
            case "UPAC":
                if (ELECTRIC.getFeeType().equals(feeType)) {
                    return "2";
                } else if (WATER.getFeeType().equals(feeType)) {
                    return "1";
                } else if (GAS.getFeeType().equals(feeType)) {
                    return "3";
                } else if (PROPERTY.getFeeType().equals(feeType)) {
                    return "28";
                } else if (CATV.getFeeType().equals(feeType)) {
                    return "19";
                } else if (BROADBAND.getFeeType().equals(feeType)) {
                    return "44";
                } else if (TELEPHONE.getFeeType().equals(feeType)) {
                    return "44";
                } else {
                    return feeType;
                }
            default:
                return feeType;
        }
    }
}
